// src/models/userModel.ts
import { useEffect, useState } from 'react';
import { getUserSelect } from '@/services/ant-design-pro/user';

export default function Page() {
  const [user, setUser] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    getUserSelect().then((res) => {
        const r = res?.data?.map((item: any) => {
            return {
              value: item.userCode,
              label: item.userName,
            };
          });
         
      setUser(r||[]);
      setLoading(false);
    });
  }, []);

  return {
    user,
    loading,
  };
};